import request from "@/utils/request";
import { getParamsSuffix } from "@/utils/paramsUtils";

/**
 * 分页
 * @param params
 * @returns {Promise<any>}
 */
export async function listAllData(params) {
    return request('/api/cdcerservice/v1/riskfactor/listAllData', {
        method: 'POST',
        requestType: 'form',
        data: { ...params },
    });
}

// 风险因素导出
export async function exportSelfTestTable(params) {

    return request(`/api/cdcerserver/v1/riskfactor/exportSelfTestTable`, {
        method: 'POST',
        
        requestType: 'form',
        responseType: 'blob',
        data: {
            ...params
        }
    });
}


/**
 * 查看详情
 * @param query
 * @returns {Promise<any>}
 */
export async function viewDetails(query) {
    const params = getParamsSuffix(query);
    return request(`/api/cdcerservice/v1/riskfactor/getContentById?${params}`);
}
